﻿#ifndef QOPENGLSKYBOXWIDGET_H
#define QOPENGLSKYBOXWIDGET_H

#include <QBasicTimer>
#include <QOpenGLBuffer>
#include <QOpenGLFunctions_4_1_Core>  
#include <QOpenGLShaderProgram>
#include <QOpenGLTexture>
#include <QOpenGLWidget>
#include <QWidget>

class QOpenGLSkyboxWidget : public QOpenGLWidget, protected QOpenGLFunctions_4_1_Core
{
   // Q_OBJECT
public:
     QOpenGLSkyboxWidget(const QString& frontImagePath,
        const QString& backImagePath,
        const QString& topImagePath,
        const QString& bottomImagePath,
        const QString& leftImagePath,
        const QString& rightImagePath,
        QWidget *parent = nullptr);

    ~QOpenGLSkyboxWidget();

protected:
    void initializeGL() override;
    void paintGL() override;
    void resizeGL(int w, int h) override;



private:
    void loadImages();

    QOpenGLShaderProgram mProgram;
    GLuint vbo, vao;

    QOpenGLTexture mTexture;


    QString mFrontImagePath;
    QString mBackImagePath;
    QString mTopImagePath;
    QString mBottomImagePath;
    QString mLeftImagePath;
    QString mRightImagePath;
};

#endif // QOPENGLSKYBOXWIDGET_H